<?php
use Mirage\Base\Config;
use Mirage\Web;
use Mirage\Util\ClientScript;
/**
 * Description of MovieManagerModule
 * Date Created Mar 18, 2012 8:24:48 PM
 * @package 
 * @author Bryan Salazar
 * 
 */
class MovieManagerModule extends Mirage\Abstraction\AbstractModule{
    public $baseAssets;
    
    public function initialize() {
        $moviePath = Web::app()->getModulePath() . DIRECTORY_SEPARATOR . 'movie' . DIRECTORY_SEPARATOR;
        $this->setControllerPath($moviePath . 'controllers');
        $this->setErrorHandler('Error', 'error404');
        $this->defaultController = 'Movie';
        \Mirage\Autoload::directoryAutoload(array(
            __DIR__.'/components',
            __DIR__.'/forms',
            __DIR__.'/models'
        ));
        ClientScript::app()
                ->setPublish(true)
                ->setAssetsPath(Web::app()->getBasePublicPath() . DIRECTORY_SEPARATOR . 'assets')
                ->publish(Web::app()->getModulePath() . DIRECTORY_SEPARATOR . 'movie' . DIRECTORY_SEPARATOR . 'assets');
    }
}
